package net.bolue.sysmng.tblbean;

import java.util.Iterator;
import java.util.Map;
import java.util.Set;


/**
 * 报表数据列
 * @author Administrator
 *
 */
public class RepField extends TableBean{

	/**
	 * 子系统
	 */
	private String subSys;
	
	/**
	 * 报表id
	 */
	private Integer repId;
	
	/**
	 * 数据列标识
	 */
	private String fieldId;
	
	/**
	 * 数据列序号
	 */
	private Integer fieldNo;
	
	/**
	 * 数据表名
	 */
	private String tableName;
	
	/**
	 * 查询列名
	 */
	private String colName;
	
	/**
	 * 显示名称
	 */
	private String dispName;
	
	/**
	 * 报表列显示类型
	 * 1:普通显示
	 * 2:数据链接
	 * 3:操作链接
	 * 4:编辑链接
	 * 5:删除链接
	 * 6:批量删除
	 * 7:复选框
	 * 8:单选框
	 * 9:带文本复选框
	 * 10:带文本单选框
	 * 11:明细显示分隔列
	 */
	private Integer dispType;
	
	/**
	 * 数据类型
	 */
	private Integer jtype;
	
	/**
	 * 字典类型
	 * 0无字典
	 * 1数字字典
	 * 2字符字典
	 * 4引用字典
	 */
	private Integer dicKind;
	
	/**
	 * 字典子系统
	 */
	private String dicSubSys;
	
	/**
	 * 字典子系统
	 */
	private Integer dicGrpId;
	
	/**
	 * 链接TARGET
	 * _self:本窗口
	 * _pop:弹窗
	 */
	private String linkTarget;
	
	/**
	 * 链接URL
	 */
	private String linkUrl;
	
	/**
	 * 是否可编辑
	 */
	private Integer isEdit;
	
	/**
	 * 是否记录值
	 */
	private Integer isTagValue;
	
	/**
	 * 链接询问信息
	 */
	private String queryInfo;
	
	/**
	 * URL参数列集
	 */
	private String paramFields;
	
	/**
	 * 一次表达式
	 */
	private String firstExp;
	
	/**
	 * 显示表达式
	 */
	private String dispExp;
	
	/**
	 * 备注
	 */
	private String remark;
	
	public RepField(){
		
	}
	
	public RepField(String subSys, Integer repId, String fieldId,
			Integer fieldNo, String tableName, String colName, String dispName) {
		super();
		this.subSys = subSys;
		this.repId = repId;
		this.fieldId = fieldId;
		this.fieldNo = fieldNo;
		this.tableName = tableName;
		this.colName = colName;
		this.dispName = dispName;
	}

	public String getSubSys() {
		return subSys;
	}

	public void setSubSys(String subSys) {
		this.subSys = subSys;
	}

	public Integer getRepId() {
		return repId;
	}

	public void setRepId(Integer repId) {
		this.repId = repId;
	}

	public String getFieldId() {
		return fieldId;
	}

	public void setFieldId(String fieldId) {
		this.fieldId = fieldId;
	}

	public Integer getFieldNo() {
		return fieldNo;
	}

	public void setFieldNo(Integer fieldNo) {
		this.fieldNo = fieldNo;
	}

	public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	public String getColName() {
		return colName;
	}

	public void setColName(String colName) {
		this.colName = colName;
	}

	public String getDispName() {
		return dispName;
	}

	public void setDispName(String dispName) {
		this.dispName = dispName;
	}
	
	public Integer getDispType() {
		return dispType;
	}

	public void setDispType(Integer dispType) {
		this.dispType = dispType;
	}

	public Integer getJtype() {
		return jtype;
	}

	public void setJtype(Integer jtype) {
		this.jtype = jtype;
	}

	public Integer getDicKind() {
		return dicKind;
	}

	public void setDicKind(Integer dicKind) {
		this.dicKind = dicKind;
	}

	public String getDicSubSys() {
		return dicSubSys;
	}

	public void setDicSubSys(String dicSubSys) {
		this.dicSubSys = dicSubSys;
	}

	public Integer getDicGrpId() {
		return dicGrpId;
	}

	public void setDicGrpId(Integer dicGrpId) {
		this.dicGrpId = dicGrpId;
	}
	
	public String getLinkTarget() {
		return linkTarget;
	}

	public void setLinkTarget(String linkTarget) {
		this.linkTarget = linkTarget;
	}

	public String getLinkUrl() {
		return linkUrl;
	}

	public void setLinkUrl(String linkUrl) {
		this.linkUrl = linkUrl;
	}

	public String getParamFields() {
		return paramFields;
	}

	public void setParamFields(String paramFields) {
		this.paramFields = paramFields;
	}

	public String getFirstExp() {
		return firstExp;
	}

	public void setFirstExp(String firstExp) {
		this.firstExp = firstExp;
	}

	public String getDispExp() {
		return dispExp;
	}

	public void setDispExp(String dispExp) {
		this.dispExp = dispExp;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getQueryInfo() {
		return queryInfo;
	}

	public void setQueryInfo(String queryInfo) {
		this.queryInfo = queryInfo;
	}

	public Integer getIsEdit() {
		return isEdit;
	}

	public void setIsEdit(Integer isEdit) {
		this.isEdit = isEdit;
	}
	
	public Integer getIsTagValue() {
		return isTagValue;
	}

	public void setIsTagValue(Integer isTagValue) {
		this.isTagValue = isTagValue;
	}

	@Override
	public TableBean mapToEntry(Map<String, Object> map) {
		RepField repField = new RepField();
		Set<String> keySet = map.keySet();
		Iterator<String> keyIt = keySet.iterator();
		while(keyIt.hasNext()){
			String key = keyIt.next();
			Object o = map.get(key);
			if("SUBSYS".equals(key)){
				repField.setSubSys((String)o);
			} else if("REPID".equals(key)){
				repField.setRepId((Integer)o);
			} else if("FIELDID".equals(key)){
				repField.setFieldId((String)o);
			} else if("FIELDNO".equals(key)){
				repField.setFieldNo((Integer)o);
			} else if("TBLNAME".equals(key)){
				repField.setTableName((String)o);
			} else if("COLNAME".equals(key)){
				repField.setColName((String)o);
			} else if("DISPNAME".equals(key)){
				repField.setDispName((String)o);
			} else if("DISPTYPE".equals(key)){
				repField.setDispType((Integer)o);
			} else if("JTYPE".equals(key)){
				repField.setJtype((Integer)o);
			} else if("DICKIND".equals(key)){
				repField.setDicKind((Integer)o);
			} else if("DICSUBSYS".equals(key)){
				repField.setDicSubSys((String)o);
			} else if("DICGRPID".equals(key)){
				repField.setDicGrpId((Integer)o);
			} else if("LINKTARGET".equals(key)){
				repField.setLinkTarget((String)o);
			} else if("LINKURL".equals(key)){
				repField.setLinkUrl((String)o);
			} else if("PARAMFIELDS".equals(key)){
				repField.setParamFields((String)o);
			} else if("ISEDIT".equals(key)){
				repField.setIsEdit((Integer)o);
			} else if("ISTAGVALUE".equals(key)){
				repField.setIsTagValue((Integer)o);
			} else if("QUERYINFO".equals(key)){
				repField.setQueryInfo((String)o);
			} else if("FIRSTEXP".equals(key)){
				repField.setFirstExp((String)o);
			} else if("DISPEXP".equals(key)){
				repField.setDispExp((String)o);
			} else if("REMARK".equals(key)){
				repField.setRemark((String)o);
			}
		}
		return repField;
	}
	
	@Override
	public String tableName(){
		return "st_repfield";
	}
	
	@Override
	public String keyProps() {
		return "SUBSYS,REPID,FIELDID";
	}
	
	
}
